package com.czy.workflow.core.service.dao;

import com.czy.workflow.core.model.FlowDocument;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface DocRepository {

    @Query("select d from flow_document d, flow_runtime_node rn, flow_node n "
            + "where d.doc_id = rn.doc_id and rn.node_id = n.id and n.element_id = ?1")
    List<FlowDocument> queryByElement(String elementId);


    @Query("select d from flow_document d, flow_runtime_node rn, flow_node n "
            + "where d.doc_id = rn.doc_id and rn.node_id = n.id and n.element_id in (?1)")
    List<FlowDocument> queryByElements(List<String> elementIds);

}
